package org.come.Jpanel;

import java.awt.CardLayout;
import java.awt.Dimension;

import javax.swing.JPanel;

import org.come.bean.GangResultBean;

public class FactionCardJpanel extends JPanel {

    private CardLayout cardLayout;
    private FactionPandectJpanel factionPandectJpanel;
    private FactionMemberJpanel factionMemberJpanel;
    private FactionWarJpanel factionWarJpanel;

    private GangResultBean gangResultBean;

    public FactionCardJpanel() {
        setPreferredSize(new Dimension(662, 475));
        setOpaque(false);
        cardLayout = new CardLayout();
        setLayout(cardLayout);

        factionPandectJpanel = new FactionPandectJpanel(this);
        this.add(factionPandectJpanel, "pandect");
        factionMemberJpanel = new FactionMemberJpanel(this);
        this.add(factionMemberJpanel, "member");
        factionWarJpanel = new FactionWarJpanel();
        this.add(factionWarJpanel, "war");

    }

    /** 初始化展示数据 */
    public void showMessage(GangResultBean gangResultBean) {
        this.gangResultBean = gangResultBean;
        factionMemberJpanel.showMenuMessage(gangResultBean);
        factionMemberJpanel.showBtn(false);
        factionMemberJpanel.showBtn(true);
        factionPandectJpanel.showFactionMessage(gangResultBean.getGang(),gangResultBean.getGangGroup());
    }

    public CardLayout getCardLayout() {
        return cardLayout;
    }

    public void setCardLayout(CardLayout cardLayout) {
        this.cardLayout = cardLayout;
    }

    public FactionPandectJpanel getFactionPandectJpanel() {
        return factionPandectJpanel;
    }

    public void setFactionPandectJpanel(FactionPandectJpanel factionPandectJpanel) {
        this.factionPandectJpanel = factionPandectJpanel;
    }

    public FactionMemberJpanel getFactionMemberJpanel() {
        return factionMemberJpanel;
    }

    public void setFactionMemberJpanel(FactionMemberJpanel factionMemberJpanel) {
        this.factionMemberJpanel = factionMemberJpanel;
    }

    public FactionWarJpanel getFactionWarJpanel() {
        return factionWarJpanel;
    }

    public void setFactionWarJpanel(FactionWarJpanel factionWarJpanel) {
        this.factionWarJpanel = factionWarJpanel;
    }

    public GangResultBean getGangResultBean() {
        return gangResultBean;
    }

    public void setGangResultBean(GangResultBean gangResultBean) {
        this.gangResultBean = gangResultBean;
    }

}
